<?php namespace Common\Model;
use \Hdphp\Model\Model;
/*
 * 网站配置模型
 * */
 class Web extends Model
 {
 	protected $table ="webset";
	protected $validate = array();
	public function edit()
	{
		//p($_POST);die;
		foreach($_POST as $k =>$v){
			//p($k);die;
			$this->where("name",$k)->update(array("value"=>$v));
		}
		$data = var_export($_POST,true);
		//p($data);die;
		$str = <<<str
<?php 
	return {$data};
?>
str;
		file_put_contents("Config/webset.php", $str);
		return TRUE;
	}
 }
